package com.surfilter.platform.base.servlet;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.surfilter.platform.base.service.ServiceContext;
import com.surfilter.platform.base.service.ServiceImpl;

public class SurfilterServlet extends HttpServlet {
	
	private static final long serialVersionUID = 7256892980263799739L;
	
    public SurfilterServlet() {
        super();
    }

	public void init(ServletConfig config) throws ServletException {
		
	}

	public void destroy() {
		
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doService(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doService(request, response);
	}

	private void doService(HttpServletRequest request, HttpServletResponse response){
		try{
			ServiceImpl.doService(request, response);
		}catch(Exception e){
			throw new RuntimeException(e);
		}
	}
}
